home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
406_01
/
atoc
/
atoc.c
< prev
next >
Wrap
Text File
|
1993-11-09
|
1KB
|
51 lines
/*=========================================================================
ATOC atoc module
=========================================================================*/
#include <stdio.h>
#include "atoc.h"
/*-------------------------------------------------------------------------
atoc( fi, fo ) is the top level atoc function.
-------------------------------------------------------------------------*/
atoc( fi, fo )
FILE *fi, *fo;
{
decflag = FALSE;
endifcount = 0;
for ( linenumber = 1; getline( fi, buffer ); ++linenumber )
{
if ( strlen( buffer ) )
{
comment( buffer );
preprocessor( fo, buffer );
keywords( fo, buffer );
autoaggregates( buffer ); /* must be after keywords() */
labels( buffer );
stdmacro( buffer );
trigraph( buffer );
constant( buffer ); /* must be after trigraph() */
function( buffer ); /* must be after comment(), keywords() */
}
fprintf( fo, "%s\n", buffer );
if ( decflag )
{
declarations( fo );
decflag = FALSE;
}
if ( exitcode )
return;
}
if ( ! endif_stack_empty() )
{
error( "Not enough #endif(s)" );
exitcode = 1;
return;
}
}
/*=======================================================================*/